/*
 * @Author: dengyl
 * @Date: 2022-02-11 17:03:13
 * @LastEditTime: 2022-04-14 16:32:00
 * @LastEditors: 詹真琦(legendryztachi@gmail.com)
 * @Description: 节点动作机制处理
 * @FilePath: \code\cwp-front\pc-collaboration\src\plugins\mixins\handle-nodes.js
 */
import handleObj from '@/handles/handle-list/summary';
export default {
    data() {
        return {
            loading: false, // 加载中
        };
    },
    methods: {
        /**
         * @description: 按钮操作
         * @param {Object}item 当前按钮
         */
        handle(item) {
            if (item.codes) {
                Promise.all(item.codes.reduce((arr, i) => arr.concat(handleObj(i)), [])).finally(
                    () => {}
                );
            } else {
                handleObj[item.handle].call(this, item).finally(() => {
                    item.loading = false;
                });
            }
        },
    },
};
